package com.example.vv.model.setupItem;

import android.content.Context;

import android.view.View;

import com.example.vv.R;
import com.example.vv.adapter.BaseRecyclerViewAdapter;
import com.example.vv.fragmentWork.entity.NaviEntity;
import com.example.vv.fragmentWork.entity.TreeEntity;
import com.example.vv.fragmentWork.mvp.MvpFragment;
import com.example.vv.model.setupItem.base.contract.SetupItemContract;
import com.example.vv.model.setupItem.base.presenter.SetupItemPresenter;
import java.util.List;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;


public class SetupItemFragment extends MvpFragment<SetupItemContract.View, SetupItemPresenter> implements SetupItemContract.View {

    @BindView(R.id.setup_item_recycler)
    RecyclerView setupItemRecycler;
    private String index;

    public SetupItemFragment() {
    }

    public SetupItemFragment(String index) {
        this.index = index;
    }

    @Override
    public int initLayout() {
        return R.layout.fragment_setup_item;
    }

    @Override
    public SetupItemPresenter initPresenter() {
        return new SetupItemPresenter();
    }

    @Override
    public void initView() {

    }

    @Override
    public void lazyLoad() {
        if (index.equals("navi")) {
            presenter.setNative();
        }
    }

    @Override
    public void initData() {

    }

    @Override
    public void doBusiness() {

    }

    @Override
    public View titleBar() {
        return null;
    }


    @Override
    public Context getMContext() {
        return getActivity();
    }


    @Override
    public void getNative(List<NaviEntity> naviEntities) {
        BaseRecyclerViewAdapter<NaviEntity> naviEntityBaseRecyclerViewAdapter = presenter.setNativeAdapter(naviEntities, getActivity());
        setupItemRecycler.setAdapter(naviEntityBaseRecyclerViewAdapter);
    }
}